package com.ylw;

import java.io.File;
import java.io.IOException;

import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;

public class Test {
    public static void main(String[] args) throws IOException, IllegalArgumentException {
        try (ScanResult scanResult = // Assign scanResult in try-with-resources
                new ClassGraph() // Create a new ClassGraph instance
                        .verbose() // If you want to enable logging to stderr
                        .enableAllInfo() // Scan classes, methods, fields, annotations
                        .acceptPackages("io.github") // Scan com.xyz and subpackages
                        .scan()) { // Perform the scan and return a ScanResult
            // Use the ScanResult within the try block, e.g.
            // ClassInfo widgetClassInfo = scanResult.getClassInfo("io.github.classgraph.ClassInfo");
            // ...
            // System.out.println(widgetClassInfo.toString());
            // System.out.println(widgetClassInfo.toStringWithSimpleNames());

            // https://dreampuf.github.io/GraphvizOnline/
            // https://github.com/magjac/d3-graphviz
            // https://www.npmjs.com/package/d3-graphviz
            // https://www.npmjs.com/search?q=Graphviz
            // https://github.com/mdaines/viz.js
            // https://www.bing.com/search?q=graphviz+online&mkt=zh-CN
            // https://github.com/i-net-software/JWebAssembly#status-of-the-project
            scanResult.getAllClasses().generateGraphVizDotFile(new File("build/output.dot"));
        }
    }
}